<% content_for :content do %>
  
<h3>Dane ankiety</h3>    
  
<div class="depot-form">
	<% @filled_survey=FilledSurvey.find(params[:id])%>
	<%= render :partial=>"filled_survey_header",:locals=>{:filled_survey=>@filled_survey}  -%>
	<% if params[:surveyer_req]!=nil && @filled_survey.survey.anonymous=="n" %>
		<p><b>Wypełniający:</b>
		<%=@filled_survey.user.login %>
		</p>		
	<% end %>
	 	<% @i=0 %>
	  
 	<% for question in  @filled_survey.survey.questions %>
  		<p><b>Pytanie <%=@i+1 %>. </b><%= question.question %> </p>
			
 			<% if question.closedquestion==nil	%>
 			<p>
				<%= @filled_survey.oqanswers.find(:first, :conditions => "question_id='#{question.id}'").answer %>
  			</p>
			<% end %>
			
			<% if question.closedquestion!=nil	%>	
 			<p>
 				
 				<% for answer in question.closedquestion.cqpossibleanswers %>
 					<p>
 					<%= answer.possibleAnswer %>
 						<% if @filled_survey.cqanswers.find(:first, :conditions => "POSSIBLE_ANSWER_ID='#{answer.id}'")!=nil	%>	
 								<INPUT TYPE="CHECKBOX" NAME="btn1" VALUE="good" DISABLED CHECKED>
 						<% else%>
 								<INPUT TYPE="CHECKBOX" NAME="btn1" VALUE="good" DISABLED>
 						<% end %>
			
					</p>
				
				<% end %>
				
  			</p>
			<% end %>
			
			
	  	<% @i=@i+1 %>
    <% end %>
	
	<%= link_to 'Powrót',:back %>

</div>
<% end %>